At least some example embodiments of the inventive concepts relate to a memory device supporting both a cache mode and a memory mode, and a method of operating the same.
In a computer system, a cache is used to reduce degradation in the performance of the computer system, caused by long access latency of a main memory. The cache includes a tag array and a data array. Among these arrays, the data array occupies a great part of the cache. In a cache mode, the data array may be used as a cache of the main memory.
However, in particular cases, it is more efficient to use the data array in a memory mode (or a scratch pad mode) than in the cache mode. For example, when the size of a dynamic memory working set of an application is far greater than the capacity of the cache, a specific page with high locality may be allocated using the data array as a mapping space of a memory.
If the data array supports both the cache mode and the memory mode, intervention of software is needed to maintain data coherency when a mode of the data array is changed. For example, when the data array is switched from the cache mode to the memory mode, all of dirty cache lines of the data array should be flushed to the main memory, thereby increasing latency for the mode change.